package fracPackage;

import java.awt.*;

public class FractalPoint extends pObject 
{
	private double x, y;
	private int nIter;
	private Iteration pIter;

	public FractalPoint(int i0, int j0, double x0, double y0, Iteration iter) 
	{
		super(x0, y0);
		x = x0;
		y = y0;
		nIter = 0;
		pIter = iter;
	}

	public int nIter() 
	{
		return nIter;
	}

	public boolean isOut() 
	{
		return super.isOut(pIter, x, y);
	}

	public void iterate(int n) 
	{
		int i = 0;
		while (i < n && !isOut())
		{
			i++;
			super.iterate(pIter, x, y);
		}
		nIter += i;
	}
	public Color color(ColorScheme cSchm) 
	{
		if (isOut()) return cSchm.color(nIter);
		return Color.black;
	}
}
